<template>
    <div class="app-container">
        <el-form :inline="true" :model="formInline" class="demo-form-inline" label-width="130px" size="small">
            <el-form-item label="开始考试日期" label-width="100px">
                <el-date-picker size="small" @change="svdateChange" value-format="yyyy-MM-dd" v-model="initParams1.svdate"
                    type="date" placeholder="选择日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="结束考试日期">
                <el-date-picker size="small" @change="svdateChange" value-format="yyyy-MM-dd" v-model="initParams1.svdate"
                    type="date" placeholder="选择日期">
                </el-date-picker>
            </el-form-item>


            <el-form-item label="姓名">
                <el-input placeholder=""></el-input>
            </el-form-item>

            <el-form-item label="车型">
                <el-select v-model="formInline.region" placeholder="请选择">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="考试科目">
                <el-select v-model="formInline.region" placeholder="请选择">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="开始录入日期" label-width="100px">
                <el-date-picker size="small" @change="svdateChange" value-format="yyyy-MM-dd" v-model="initParams1.svdate"
                    type="date" placeholder="选择日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="结束录入日期">
                <el-date-picker size="small" @change="svdateChange" value-format="yyyy-MM-dd" v-model="initParams1.svdate"
                    type="date" placeholder="选择日期">
                </el-date-picker>
            </el-form-item>

            <el-form-item label="成绩已录">
                <el-select v-model="formInline.region" placeholder="请选择">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>



            <el-form-item label="挂靠点">
                <el-select v-model="formInline.region" placeholder="请选择">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="教学教练">
                <el-select v-model="formInline.region" placeholder="请选择">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="是否过关" label-width="100px">
                <el-select v-model="formInline.region" placeholder="请选择">
                    <el-option label="区域一" value="shanghai"></el-option>
                    <el-option label="区域二" value="beijing"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label=" ">
                <el-button type="primary" icon="el-icon-search">查询</el-button>
                <el-button type="info" plain icon="el-icon-download">导出</el-button>
            </el-form-item>
        </el-form>

        <div style="height: 595px;margin-top: 10px;">
            <el-table :data="tableData" border height="100%">
                <el-table-column prop="id" label="ID" width="120" sortable align="center">
                </el-table-column>
                <el-table-column prop="tid" label="TID" width="120" sortable align="center">
                    <template slot-scope="scope">
                        <span style="color: #4d4de2;cursor: pointer;"
                            @click="go(scope.row, 'http://jx.qida999.com/DriverCommon/Area/GDHZ/DrTextReady1.html')">{{
                                scope.row.tid }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="pid" label="PID" width="120" sortable align="center">
                    <template slot-scope="scope">
                        <span style="color: #4d4de2;cursor: pointer;"
                            @click="go2(scope.row, 'http://jx.qida999.com/DriverCommon/driver/dr_person.html')">{{
                                scope.row.pid }}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="name" label="姓名" width="150" sortable align="center">
                </el-table-column>
                <el-table-column prop="car" label="车型" width="90" sortable align="center">
                </el-table-column>

                <el-table-column prop="idcard" label="身份证号码" width="180" sortable align="center">
                </el-table-column>
                <el-table-column prop="StateStr" label="当前进度" width="150" sortable align="center">
                </el-table-column>
                <el-table-column prop="result" label="分数" width="80" sortable align="center">
                </el-table-column>
                <el-table-column prop="vdate" label="考试日期" width="150" sortable align="center">
                </el-table-column>

                <el-table-column prop="km" label="考试科目" width="120" sortable align="center">
                </el-table-column>

                <el-table-column prop="IsOK" label="是否过关" width="120" sortable align="center">
                </el-table-column>
                <el-table-column prop="com_name" label="挂靠点" width="120" sortable align="center">
                </el-table-column>
                <el-table-column prop="leader" label="科三教练" width="120" sortable align="center">
                </el-table-column>
                <el-table-column prop="ep" label="备注" width="200" sortable align="center">
                </el-table-column>
                <el-table-column prop="address" label="考试地点" width="250" sortable align="center">
                </el-table-column>
                <el-table-column prop="editer" label="录入人" width="150" sortable align="center">
                </el-table-column>
                <el-table-column prop="edittime" label="录入日期" width="200" sortable align="center">
                </el-table-column>
            </el-table>
        </div>
        <div class="pagin">
            <el-pagination background :current-page="initParams1.page" :page-sizes="[20, 50, 100, 150]"
                :page-size="initParams1.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"
                @size-change="handleSizeChange" @current-change="handleCurrentChange" />
        </div>
    </div>
</template>

<script>
/**
* @author        chenRong
* @time          2023-11-17 16:12:06  星期五
* @description   
**/

import { examRecordAPI } from '@/api/adminstare'
import { today } from '@/utils/date'
export default {
    data() {
        return {
            formInline: {
                user: '',
                region: '',
            },
            value1: '',
            tableData: [],
            // 账号列表初始化参数
            initParams1: {
                action: "examRecordList",
                page: 1,
                pageSize: 20,
                svdate: "",//考试起止日期
            },
            total: 100,
        }
    },
    mounted() {
        this.getListData()
    },
    methods: {
        async getListData() {
            try {
                const result = await examRecordAPI(this.initParams1)
                this.total = result.total
                this.tableData = result.data

                console.log(result);
            } catch (error) {
                console.log(error);
            }
        },

        //  跳旧版详情
        go(val, URL) {
            const redirectUrl = `${URL}?id=${val.tid}&aid=${this.$store.getters.userInfo.jxid}`
            this.$oldLoginSystem(redirectUrl)
        },
        go2(val, URL) {
            const redirectUrl = `${URL}?id=${val.pid}&aid=${this.$store.getters.userInfo.jxid}`
            this.$oldLoginSystem(redirectUrl)
        },

        // 考试日期发生变化
        svdateChange(date) {
            if (date == null) {
                this.initParams1.svdate = ""
            }
            this.getListData()
        },

        // 一页几条数据
        handleSizeChange(val) {
            this.initParams1.pageSize = val

        },
        // 当前页
        handleCurrentChange(val) {
            this.initParams.page = val
        },
    }
}
</script>

<style lang="scss" scoped></style>